﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tunnel.DevicesControls
{
    public partial class CMS : TextBox
    {
        public CMS()
        {
            InitializeComponent();
        }

        private string numOfText;
        private string backgroundColor;
        private string textColor;

        public string NumOfText
        {
            get
            {
                return numOfText;
            }

            set
            {
                if (value == "两行")
                {
                    this.Font = new Font(this.Font.FontFamily.ToString(), 38);
                }
                if (value == "三行")
                {
                    this.Font = new Font(this.Font.FontFamily.ToString(), 28);
                }
                if (value == "四行")
                {
                    this.Font = new Font(this.Font.FontFamily.ToString(), 21);
                }
                numOfText = value;
            }
        }

        public string BackgroundColor
        {
            get
            {
                return backgroundColor;
            }

            set
            {
                if (value == "红色")
                {
                    this.ForeColor = Color.Red;
                }
                if (value == "绿色")
                {
                    this.ForeColor = Color.Green;
                }
                if (value == "白色")
                {
                    this.ForeColor = Color.White;
                }
                if (value == "黄色")
                {
                    this.ForeColor = Color.Yellow;
                }
                backgroundColor = value;
            }
        }

        public string TextColor
        {
            get
            {
                return textColor;
            }

            set
            {
                if (value == "黑色")
                {
                    this.ForeColor = Color.Black;
                }
                if (value == "白色")
                {
                    this.ForeColor = Color.White;
                }
                
                textColor = value;
            }
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }
    }
}
